package com.dynamic.mybatis.core.metadata;

import com.dynamic.mybatis.core.enums.ReturnType;
import org.apache.ibatis.mapping.SqlCommandType;

import java.util.Map;

/**
 * @Description
 * 支持 mybatis xml mapper标签内的动态SQL
 * <select></select>
 * <insert></insert>
 * <update></update>
 * <delete></delete>
 * <parameterMap></parameterMap>
 * <resultMap></resultMap>
 * <sql></sql>
 * @Author xs
 * @Date 2021/3/26 14:29
 */
public class DynamicXmlMappedStatement extends DynamicMappedStatement {


    public static class Builder{
        private   DynamicXmlMappedStatement  dxms;

        public Builder() {
            dxms = new DynamicXmlMappedStatement();;
        }


        public String getId() {
            return dxms.getId();
        }

        public Builder setId(String id) {
            dxms.setId(id);
            return this;
        }

        public SqlCommandType getSqlCommandType() {
            return dxms.getSqlCommandType();
        }

        public Builder setSqlCommandType(SqlCommandType sqlCommandType) {
             dxms.setSqlCommandType(sqlCommandType);
            return this;
        }

        public ReturnType getReturnType() {
           return  dxms.getReturnType();
        }

        public Builder setReturnType(ReturnType returnType) {
           dxms.setReturnType(returnType);
            return this;
        }

        public String getMappedStatement() {
            return dxms.getMappedStatement();
        }

        public Builder setMappedStatement(String mappedStatement) {
            dxms.setMappedStatement(mappedStatement);
            return this;
        }

        public String getParameterType() {
            return dxms.getParameterType();
        }

        public Builder setParameterType(String parameterType) {
            dxms.setParameterType(parameterType);
            return this;
        }

        public Object getTargetDataSourceKey() {
            return dxms.getTargetDataSourceKey();
        }

        public Builder setTargetDataSourceKey(Object targetDataSourceKey) {
            dxms.setTargetDataSourceKey(targetDataSourceKey);
            return this;
        }

        public Object[] getDynamicDataSourceKeys() {
            return dxms.getDynamicDataSourceKeys();
        }

        public Builder setDynamicDataSourceKeys(Object[] dynamicDataSourceKeys) {
            dxms.setDynamicDataSourceKeys(dynamicDataSourceKeys);
            return this;
        }

        public Map<String, Object> getAttributes() {
            return dxms.getAttributes();
        }

        public Builder setAttributes(Map<String, Object> attributes) {
            dxms.getAttributes();
            return this;
        }

        public DynamicXmlMappedStatement builder(){
            return dxms;
        }
    }


    

}